﻿using System.Collections.Generic;

namespace SegmentDisplay.Common.Digit14
{
    public static class ValueSet14
    {
        public static Dictionary<string, Values14> Alphabet = new Dictionary<string, Values14>();

        static ValueSet14()
        {
            Alphabet.Add("Empty", Values14.SimbolEmpty);
            Alphabet.Add("0", Values14.Digit0);
            Alphabet.Add("1", Values14.Digit1);
            Alphabet.Add("2", Values14.Digit2);
            Alphabet.Add("3", Values14.Digit3);
            Alphabet.Add("4", Values14.Digit4);
            Alphabet.Add("5", Values14.Digit5);
            Alphabet.Add("6", Values14.Digit6);
            Alphabet.Add("7", Values14.Digit7);
            Alphabet.Add("8", Values14.Digit8);
            Alphabet.Add("9", Values14.Digit9);
            Alphabet.Add("n", Values14.Digitn);
            Alphabet.Add("L", Values14.DigitL);
            Alphabet.Add("o", Values14.Digito);
            return;
        }

        public static Values14 GetVector(string simbol)
        {
            Values14 result = Values14.SimbolEmpty;
            if(!string.IsNullOrEmpty(simbol))
            {
                string invariant = simbol.Trim().ToUpper();
                if (invariant.Length == 1)
                    Alphabet.TryGetValue(invariant, out result);
            }
            return result;
        }
    }
}
